home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Shareware / Programare / magiccd / mcdbc111t.exe / %MAINDIR% / Simple C++ / Demo2.cpp < prev   
Encoding:
C/C++ Source or Header  |  2004-03-08  |  2.0 KB  |  48 lines

  1. /******************************************************************************
  2.  
  3.                       Four very simple steps to burn a Data CD/DVD
  4.  
  5. /******************************************************************************/
  6.  
  7. #include <stdio.h>
  8. #include <conio.h>
  9. #include "..\..\include\MCDBCls.h"
  10.  
  11. /******************************************************************************/
  12.  
  13. CMCDBurner mcdb;
  14.  
  15. int main()
  16. {
  17.    mcdb.SelectDevice(0);                                               // Step 1: Selecting First device
  18.    mcdb.SetVolumeID("binarymagics.com");                               // Set Volume Label (Not required)
  19.  
  20.    //mcdb.InsertFile("\\", "c:\\autoexec.bat");                           // Step 2: File to Burn
  21.    mcdb.InsertDir("\\", "c:\\Program Files\\Windows Media Player\\", "*.*", TRUE, FALSE);                // Step 2: Dir to Burn
  22.    mcdb.Prepare();                                                     // Step 3: Prepare the data for Burning
  23.    if (mcdb.Burn(&CMCDBurner::WriteDone, NULL) == TRUE)                   // Step 4: Now Burn the File/Dir
  24. // if (mcdb.BuildISOImage("c:\\test.iso",&CMCDBurner::WriteDone, NULL) == TRUE)      // Step 4: If want to Build ISO File
  25.    //if (mcdb.BurnISOImage("c:\\abc.iso", &CMCDBurner::WriteDone, NULL) == TRUE)    // Step 4: if Burning ISO Image
  26.    {
  27.       printf("Please wait while burning Disc \nDon't press any key till the Write Done message comes ...");
  28.       printf("\nSo Please wait ...\n");
  29.    }
  30.    else
  31.       printf("Burn/Build start failed (ERR: %d), Press any key to exit", mcdb.GetErrorNumber());
  32.  
  33.    return getch();
  34. }
  35.  
  36. /******************************************************************************/
  37. void _stdcall CMCDBurner::EraseDone(BOOL FAILED, void *ptr)
  38. {
  39.    printf("\nErase is done ... (%s)", FAILED ? "FAILED": "SUCCESS");
  40. }
  41.  
  42. /******************************************************************************/
  43. void __stdcall CMCDBurner::WriteDone(BOOL FAILED, void *arg)
  44. {
  45.    printf("\n\nWrite done ... (%s)", FAILED ? "FAILED": "SUCCESS");
  46.  
  47. }
  48.